1. Field of the Invention
The present invention relates generally to a data processing system and in particular to a method and apparatus for managing keyboard navigation. More particularly, the present invention is directed to a computer-implemented method, apparatus, and computer-usable program code for managing keyboard navigation in a table.
2. Description of the Related Art
Many computer applications utilize tables, such as data grids, to contain, organize, or display data to a user. For example, many web-based pages on the Internet contain tables with which a user may interact using a user interface, such as a keyboard. One way that a user may interact with a table on a user interface is by navigating from cell to cell within the table. For example, a user may issue directional commands that change the cell having focus within the table. A focus is any indication associated with a particular cell that differentiates the cell from other cells in the table. This indication may be made visually using an output device, such as a display device. Non-limiting examples of a cell upon which focus is applied include a highlighted cell, a cell containing bolded or italicized contents, a cell having a unique border, a blinking cell, or a cell containing a cursor. A directional command is any command indicating a direction, such as up, down, left, right, or diagonal. A directional command may be issued by a user via a keyboard. A keyboard is any user interface containing keys that represent values, such as directional values. Non-limiting examples of a keyboard include a traditional computer keyboard, touchpad, touch screen, or similar interface.
Hypertext markup language (HTML) may be used to create tables for presentation on a user interface. JavaScript™ may also be used to implement a user's interactions with the table. JavaScript™ is a web development scripting language and is a trademark of Sun Microsystems, Inc.
Keyboard navigation within a table on a web page is not a standard HTML function. Nonetheless, languages, such as JavaScript™, may be used to capture keyboard input received by a HTML table element. The next cell to receive focus may then be determined based on the keyboard input. For example, if a user is in row one and column three of a table and presses a down value on a keyboard, the next cell to receive focus is row two and column three. In JavaScript™, the keystroke event for the down value key provides the cell currently receiving focus. In JavaScript™, this current cell may be said to have generated the keystroke event. However, inefficiencies exist when using the current methods for changing focus in a table using keyboard input.